import React from "react";
import {SidebarProvider} from "@/components/ui/sidebar";
import {ProjectSidebar} from "@/components/sidebar/project-sidebar";

export default async function ProjectLayout({children, params}: {
    children: React.ReactNode;
    params: Promise<{ projectId: string }>
}) {
    const {projectId} = await params;
    const reg = /^PJ-[A-Z0-9]{16}$/;
    if (!reg.test(projectId as string)) {
        return (
            <div className="h-screen flex flex-col items-center justify-center">
                <div className="text-sm font-normal items-start">
                    <div>{`项目ID:【${projectId}】不合法`}</div>
                    <div>请检查项目ID是否正确！</div>
                </div>
            </div>
        );
    }
    return (
        <>
            {children}
        </>
    )
}